package com.nuc.kl.module.usermanager.dao.impl;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.springframework.stereotype.Repository;

import com.nuc.kl.module.usermanager.dao.LoginDao;

@Repository
public class LoginDaoImpl implements LoginDao{
	@Resource
	private SessionFactory sessionFactory;
	
	public Object login(String loginName, String password,String userCate) {
		
		return  sessionFactory.getCurrentSession().createQuery(//
				"from "+userCate+" where loginName=? and password=?")//
				.setParameter(0,loginName)//
				.setParameter(1,password)//
				.uniqueResult();
	}
}
